/**
 * Created by baiguiren on 1/16/17.
 */


let async = require('async');

let test_arr = [1, 2, 3, 4, 5];

let res_callback = (err, results) => {
  console.log(err ? err : results);
};

async.some(test_arr, (item, callback) => {
  setTimeout(() => {
    callback(null, item >= 3);
  }, Math.random() * 100);
}, res_callback);

async.someSeries(test_arr, (item, callback) => {
 setTimeout(() => {
   callback(null, item >= 3);
 }, Math.random() * 100);
}, res_callback);

async.someLimit(test_arr, 2, (item, callback) => {
  setTimeout(() => {
    callback(null, item >= 3);
  }, Math.random() * 100);
}, res_callback);
